package com.c2b.algorithm.leetcode.base;

/**
 * @author c2b
 * @since 2024/2/23 11:39
 */
public class _LC0048RotateImage_M {

    static class Solution {
        public void rotate(int[][] matrix) {
            /*
                1(0,0)   2(0,1)   3(0,2)       7(2,0)   4(1,0)   1(0,0)
                4(1,0)   5(1,1)   6(1,2)   ==> 8(2,1)   5(1,1)   2(0,1)
                7(2,0)   8(2,1)   9(2,2)       9(2,2)   6(1,2)   3(0,2)

                row:0   col:0 。(0,2) -> (2,2) -> (2,0) -> (0,0)

                1.temp                              =   matrix[row][col]
                2.matrix[row][col]                  =   matrix[n - col - 1][row]
                3.matrix[n- col - 1][row]           =   matrix[n - row - 1][n - col - 1]
                4.matrix[n - row - 1][n - col - 1]  =   matrix[col][n - row - 1]
                5.matrix[col][n - row - 1]          =   temp
             */
        }
    }
}
